/////////////////////////////////////////////////////////////////////////////////////////////
// Filename: MessageDispatcher.h
// (c) Dave Ottley, 2012. All rights reserved.
/////////////////////////////////////////////////////////////////////////////////////////////
#ifndef MESSAGEDISPATCHER_H
#define MESSAGEDISPATCHER_H

///////////////////////////
//		INCLUDES
///////////////////////////
#include <stdint.h>

///////////////////////////
//		MY INCLUDES
///////////////////////////

class BaseGameEntity;
struct Telegram;

#define Dispatch MessageDispatcher::GetInstance()
#undef DispatchMessage // To counter a Windows macro

const double SEND_MSG_IMMEDIATELY =			0.0;
const int    NO_EXTRA_INFO   =				0;
const uint32_t    SENDER_ID_IRRELEVANT =	0;

class MessageDispatcher
{
private:
	bool Discharge(BaseGameEntity* pReceiver, const Telegram& msg);

	MessageDispatcher() {}

public:
	static MessageDispatcher * GetInstance();

	bool DispatchMessage(double		delay, // Delay is not implemented yet
						 uint32_t	sender,
						 uint32_t	receiver,
						 uint32_t	msg,
						 void*		ExtraInfo);
};



#endif